Release 10.1A: OpenEdge Development:
Programming Interfaces
Handling terminal I/O
Character-mode systems support two basic modes of terminal I/O:
In raw mode, the system reads input characters immediately and passes them to an application without any interpretation, and without sending them to the display as they are entered. Also, the system does no preprocessing or postprocessing of output characters.
In cooked mode, the system interprets input characters according to the following terminal input functions that the UNIX system defines: ERASE, KILL, INTR, QUIT, SWITCH, and EOT. Also, UNIX systems provide terminal-specific postprocessing, such as defining special characters and character mapping, echoing input to the display, etc.
Using the proscopn(), prosccls(), and promsgd() functions
In character mode, OpenEdge typically uses raw terminal I/O, but supplies HLC library functions for switching between raw and cooked mode. Ideally, leave the terminal set to raw mode and use the
promsgd()function to display information to the user. This provides a uniform appearance for messages.If necessary, you can use cooked mode for handling the screen display in character mode. In this case, use the
proscopn()function to enable cooked mode. Before returning to OpenEdge, re-enable raw mode with a call toprosccls().In character mode, the
promsgd()function displays up to two messages before displaying a “Press space bar to continue” status message. In raw mode, the user can press SPACEBAR as prompted. In cooked mode, the user must press RETURN afterpromsgd()displays the status message. To usepromsgd()in cooked mode, use the ProgressPAUSEstatement to change either the status message or the way the user interacts with the display.For example, to change the status message to tell the user to press RETURN, place the following
PAUSEstatement anywhere before the first HLC call that invokespromsgd():
To cause the display to change two seconds after displaying a message without user input, use the following statement:
In this case, you must specify the interval to pause. See the
PAUSEStatement reference entry in OpenEdge Development: Progress 4GL Reference for more information.Run the HLC demo application to see examples that include a number of
promsgd()calls illustrating these techniques.In graphical interfaces,
promsgd()displays messages in an alert box. Raw and cooked terminal I/O, and theproscopn(),proclear(), andprosccls()functions apply only to OpenEdge running in character interfaces.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |